<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			
			function paixu(arr){
				for(var i=0;i<arr.length-1;i++)
				{
					for(var j=0;j<arr.length-1-i;j++)
					{
						if(arr[j]>arr[j+1])
						{
							var temp = arr[j];
							arr[j] = arr[j+1];
							arr[j+1] = temp;
						}
					}
				}
				return arr;
			}
			
			var arr=[0,5,2,3,4,9,8,7,1,6];
			var re=paixu(arr);
			document.write(re);
		</script>
		
	</head>
	<body>
	</body>
</html>
